package com.trainsmart.example.demo.control
{
	import com.trainsmart.smartmvc.CtrlBase;
	import com.trainsmart.smartmvc.Context;
	
	import mx.controls.TextInput;
	/**
	 * this is an automatical execution control
	 */ 
	public class InitCtrl extends CtrlBase
	{
		public function InitCtrl(context:Context)
		{
			super(context);
		}
		/**
		 * if this control is registered in a static auto-run control, highly recommand to keep request is empty
		 * declair request structure:
		 * request={}
		 */ 
		override public function execute(request:Object=null, response:Function=null):void
		{
			var userIdInput:TextInput = context.getInSession("userId") as TextInput;
			userIdInput.text = "auto text-----";
		}
		
	}
}